﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Iterator_Pattern
{
    class SongsOfThe80s : SongIterator
    {
        public SongInfo[] bestSongs;
        int arrayValue = 0;

        public SongsOfThe80s()
        {
            bestSongs = new SongInfo[3];
            addSong("Roam", "B52s", 1989);
            addSong("Cruel Summer", "Bananarama", 1984);
            addSong("Head over Heels", "Tears for Fears", 1985);
        }

        public void addSong(String songName, String bandName, int yearReleased)
        {
            SongInfo songInfo = new SongInfo(songName, bandName, yearReleased);
            bestSongs[arrayValue] = songInfo;
            arrayValue++;
        }

        public IEnumerator createIterator()
        {
            return bestSongs.GetEnumerator();
        }
    }
}
